home *** CD-ROM | disk | FTP | other *** search
/ Windows Game Programming for Dummies (2nd Edition) / WinGamProgFD.iso / pc / DirectX SDK / DXSDK / samples / Multimedia / VBSamples / Demos / ClubMet / basDD.bas next >
Encoding:
BASIC Source File  |  2001-10-08  |  19.1 KB  |  588 lines

  1. Attribute VB_Name = "basDD"
  2. Option Explicit
  3.  
  4. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  5. '
  6. '  Copyright (C) 1999-2001 Microsoft Corporation.  All Rights Reserved.
  7. '
  8. '  File:       basDD.bas
  9. '
  10. '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
  11.  
  12. Public Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As DxVBLib.RECT) As Long
  13.  
  14. '******
  15. 'This application uses conditional compilation.  To run this sample in the IDE, you
  16. 'must first go to Project Properties (Project Menu-> Properties).  Then on the Make tab
  17. 'change the RunInIDE=0 to RunInIDE=1.
  18.  
  19. 'This sample also shows developers how to combine the DX7 and DX8 DLL's to create
  20. 'an app with the latest DMusic and still use older functionality like DDraw
  21.  
  22. Private dx As New DxVBLib.DirectX7
  23. Private DD As DxVBLib.DirectDraw7
  24. Private DDS As DxVBLib.DirectDrawSurface7
  25. Private dC As DxVBLib.DirectDrawClipper
  26. Private DDSD As DxVBLib.DDSURFACEDESC2
  27. Private DR As DxVBLib.RECT
  28.  
  29. Private bB As DxVBLib.DirectDrawSurface7
  30. Private BD As DxVBLib.DDSURFACEDESC2
  31. Private BBR As DxVBLib.RECT
  32.  
  33. Private ar() As Byte
  34. Private AlphaRect As DxVBLib.RECT
  35.  
  36. Private lPixelDepth As Byte
  37. Private clr As Long
  38. Private cols As Long
  39. Private rows As Long
  40. Private col As Long
  41. Private row As Long
  42.  
  43. Private Sprites(9) As DxVBLib.DirectDrawSurface7
  44. Private SpriteD(9) As DxVBLib.DDSURFACEDESC2
  45. Private SpriteR(9) As DxVBLib.RECT
  46. Private key(9) As DDCOLORKEY
  47.  
  48. Private spriteWidth As Integer
  49. Private spriteHeight As Integer
  50. Private currentframe As Integer
  51. Private slide(39) As DxVBLib.RECT
  52. Private Pal(255) As DxVBLib.PALETTEENTRY
  53. Private Palette As DxVBLib.DirectDrawPalette
  54.  
  55. Private Fish(2) As DxVBLib.DirectDrawSurface7
  56. Private fishD(2) As DxVBLib.DDSURFACEDESC2
  57. Private fishR(2) As DxVBLib.RECT
  58. Private fishkey(2) As DxVBLib.DDCOLORKEY
  59.  
  60. Private sMSG As String
  61.  
  62. Private x%, y%
  63. Private tmpR As DxVBLib.RECT
  64.  
  65. Private Type fis
  66.     sR As DxVBLib.RECT
  67.     x As Long
  68.     y As Single
  69. End Type
  70.  
  71. Private fi(2) As fis
  72.  
  73. 'Registry constants
  74. Private Const KEY_READ = 131097
  75. Private Const REG_SZ = 1
  76. Private Const HKEY_LOCAL_MACHINE = &H80000002
  77. 'Registry API's
  78. Private Declare Function RegConnectRegistry Lib "advapi32.dll" Alias "RegConnectRegistryA" (ByVal lpMachineName As String, ByVal hKey As Long, phkResult As Long) As Long
  79. Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
  80. Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, ByVal lpData As String, lpcbData As Long) As Long
  81. Private Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
  82. 'Sleep
  83. Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
  84.  
  85. Public Sub InitDD(hwnd As Long, ClipperHwnd As PictureBox)
  86.     Dim oPixelFormat As DDPIXELFORMAT
  87.     On Local Error GoTo err_
  88.     
  89.     Set DD = dx.DirectDrawCreate(vbNullString)
  90.     DD.SetCooperativeLevel hwnd, DDSCL_NORMAL
  91.     
  92.     DDSD.lFlags = DDSD_CAPS
  93.     DDSD.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE
  94.     Set DDS = DD.CreateSurface(DDSD)
  95.     
  96.     Set dC = DD.CreateClipper(0)
  97.     dC.SetHWnd ClipperHwnd.hwnd
  98.     
  99.     DDS.SetClipper dC
  100.     
  101.     DDS.GetPixelFormat oPixelFormat
  102.     
  103.     If oPixelFormat.lRGBBitCount < 8 Then
  104.         If Not (DD Is Nothing) Then
  105.             DD.SetCooperativeLevel frmMain.hwnd, DDSCL_NORMAL
  106.             DoEvents
  107.         End If
  108.     
  109.         MsgBox "Must run at 16bit color or higher.", vbApplicationModal
  110.         End
  111.     Else
  112.         lPixelDepth = oPixelFormat.lRGBBitCount
  113.     End If
  114.     
  115.     BD.lFlags = DDSD_HEIGHT Or DDSD_WIDTH Or DDSD_CAPS
  116.     BD.ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  117.     BD.lWidth = ClipperHwnd.ScaleWidth
  118.     BD.lHeight = ClipperHwnd.ScaleHeight
  119.     
  120.     Set bB = DD.CreateSurface(BD)
  121.  
  122.     BBR.bottom = ClipperHwnd.Height
  123.     BBR.Right = ClipperHwnd.Width
  124.     
  125.     loadSprites
  126.  
  127.     AlphaRect.Right = BD.lWidth - 1
  128.     AlphaRect.bottom = BD.lHeight - 1
  129.     Exit Sub
  130.  
  131. err_:
  132.     
  133.     If Not (DD Is Nothing) Then
  134.         DD.SetCooperativeLevel frmMain.hwnd, DDSCL_NORMAL
  135.         DoEvents
  136.     End If
  137.  
  138.     MsgBox "Unable to initalize DirectDraw.", vbApplicationModal
  139.     End
  140.  
  141. End Sub
  142.  
  143. Private Sub loadSprites()
  144.     '0
  145.     SpriteD(0).lFlags = DDSD_CAPS
  146.     SpriteD(0).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  147.  
  148. #If RunInIDE = 1 Then
  149.     'ide
  150.     Dim sMedia As String
  151.     
  152.     sMedia = FindMediaDir("base.bmp")
  153.     If sMedia <> vbNullString Then 'Media is not in current folder
  154.         If (Left$(sMedia, 2) <> Left$(CurDir, 2)) And (InStr(Left$(sMedia, 2), ":") > 0) Then ChDrive Left$(sMedia, 2)
  155.         ChDir sMedia
  156.     End If
  157.     
  158.     Set Sprites(0) = DD.CreateSurfaceFromFile("base.bmp", SpriteD(0))
  159. #Else
  160.     'exe
  161.     Set Sprites(0) = DD.CreateSurfaceFromResource(AddDirSep(App.Path) & App.EXEName & ".exe", "BASE", SpriteD(0))
  162. #End If
  163.  
  164.     SpriteR(0).Right = SpriteD(0).lWidth
  165.     SpriteR(0).bottom = SpriteD(0).lHeight
  166.  
  167.     
  168.     '1
  169.     SpriteD(1).lFlags = DDSD_CAPS
  170.     SpriteD(1).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  171.     
  172. #If RunInIDE = 1 Then
  173.     'ide
  174.     Set Sprites(1) = DD.CreateSurfaceFromFile("sax.bmp", SpriteD(1))
  175. #Else
  176.     'exe
  177.     Set Sprites(1) = DD.CreateSurfaceFromResource(AddDirSep(App.Path) & App.EXEName & ".exe", "sax", SpriteD(1))
  178. #End If
  179.  
  180.     SpriteR(1).Right = SpriteD(1).lWidth
  181.     SpriteR(1).bottom = SpriteD(1).lHeight
  182.     
  183.     'notes
  184.     SpriteD(6).lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH
  185.     SpriteD(6).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  186.     SpriteD(6).lWidth = 64: SpriteD(6).lHeight = 64
  187.     
  188. #If RunInIDE = 1 Then
  189.     'ide
  190.     Set Sprites(6) = DD.CreateSurfaceFromFile("notes.bmp", SpriteD(6))
  191. #Else
  192.     'exe
  193.     Set Sprites(6) = DD.CreateSurfaceFromResource(AddDirSep(App.Path) & App.EXEName & ".exe", "NOTES", SpriteD(6))
  194. #End If
  195.  
  196.     SpriteR(6).Right = SpriteD(6).lWidth
  197.     SpriteR(6).bottom = SpriteD(6).lHeight
  198.     
  199.     
  200.     key(6).low = 0
  201.     key(6).high = 0
  202.     Sprites(6).SetColorKey DDCKEY_SRCBLT, key(6)
  203.     
  204.     
  205.     
  206.     '2
  207.     SpriteD(2).lFlags = DDSD_CAPS
  208.     SpriteD(2).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  209.     
  210. #If RunInIDE = 1 Then
  211.     'ide
  212.     Set Sprites(2) = DD.CreateSurfaceFromFile("keys.bmp", SpriteD(2))
  213. #Else
  214.     Set Sprites(2) = DD.CreateSurfaceFromResource(AddDirSep(App.Path) & App.EXEName & ".exe", "KEYS", SpriteD(2))
  215. #End If
  216.  
  217.     SpriteR(2).Right = SpriteD(2).lWidth
  218.     SpriteR(2).bottom = SpriteD(2).lHeight
  219.     
  220.     
  221.     ''''''''''''''''''''''''''''''''''''''''''
  222.     'loadFish
  223.     ''''''''''''''''''''''''''''''''''''''''''
  224.     fishD(0).lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH
  225.     fishD(0).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  226.     fishD(0).lWidth = 64: fishD(0).lHeight = 64
  227.     
  228.     fishD(1).lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH
  229.     fishD(1).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  230.     fishD(1).lWidth = 64: fishD(1).lHeight = 64
  231.     
  232.     fishD(2).lFlags = DDSD_CAPS Or DDSD_HEIGHT Or DDSD_WIDTH
  233.     fishD(2).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  234.     fishD(2).lWidth = 64: fishD(2).lHeight = 64
  235.     
  236. #If RunInIDE = 1 Then
  237.  'ide
  238.     Set Fish(0) = DD.CreateSurfaceFromFile("f1.bmp", fishD(0))
  239.     Set Fish(1) = DD.CreateSurfaceFromFile("f2.bmp", fishD(1))
  240.     Set Fish(2) = DD.CreateSurfaceFromFile("f3.bmp", fishD(2))
  241. #Else
  242. 'exe
  243.     Set Fish(0) = DD.CreateSurfaceFromResource(AddDirSep(App.Path) & App.EXEName & ".exe", "F1", fishD(0))
  244.     Set Fish(1) = DD.CreateSurfaceFromResource(AddDirSep(App.Path) & App.EXEName & ".exe", "F2", fishD(1))
  245.     Set Fish(2) = DD.CreateSurfaceFromResource(AddDirSep(App.Path) & App.EXEName & ".exe", "F3", fishD(2))
  246. #End If
  247.  
  248.  
  249.     
  250.     Dim i As Integer
  251.     
  252.     For i = 0 To UBound(Fish)
  253.         fishR(i).Right = fishD(i).lWidth
  254.         fishR(i).bottom = fishD(i).lHeight
  255.         fishkey(i).low = 0
  256.         fishkey(i).high = 0
  257.         Fish(i).SetColorKey DDCKEY_SRCBLT, fishkey(i)
  258.     Next i
  259.     
  260.     
  261.     'sprite(5) animated hand
  262.     
  263.     SpriteD(5).lFlags = DDSD_CAPS
  264.     SpriteD(5).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  265.     
  266. #If RunInIDE = 1 Then
  267.     'ide
  268.     Set Sprites(5) = DD.CreateSurfaceFromFile("handani.bmp", SpriteD(5))
  269. #Else
  270.     'exe
  271.     Set Sprites(5) = DD.CreateSurfaceFromResource(AddDirSep(App.Path) & App.EXEName & ".exe", "handani", SpriteD(5))
  272. #End If
  273.     
  274.  
  275.     SpriteR(5).Right = SpriteD(5).lWidth
  276.     SpriteR(5).bottom = SpriteD(5).lHeight
  277.     spriteWidth = 272
  278.     spriteHeight = 177
  279.     cols = SpriteD(5).lWidth / spriteWidth
  280.     rows = SpriteD(5).lHeight / spriteHeight
  281.     
  282.     key(5).low = 0
  283.     key(5).high = 0
  284.     Sprites(5).SetColorKey DDCKEY_SRCBLT, key(5)
  285.     
  286.     
  287.     '9
  288.     SpriteD(9).lFlags = DDSD_CAPS
  289.     SpriteD(9).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  290.     
  291. #If RunInIDE = 1 Then
  292.     'ide
  293.     Set Sprites(9) = DD.CreateSurfaceFromFile("bknote.bmp", SpriteD(9))
  294. #Else
  295.     'exe
  296.     Set Sprites(9) = DD.CreateSurfaceFromResource(AddDirSep(App.Path) & App.EXEName & ".exe", "bknote", SpriteD(9))
  297. #End If
  298.     
  299.  
  300.     SpriteR(9).Right = SpriteD(9).lWidth
  301.     SpriteR(9).bottom = SpriteD(9).lHeight
  302.         
  303.         
  304.     StripVert slide(), SpriteR(9).Right, SpriteR(9).bottom
  305.     
  306.     '8
  307.     SpriteD(8).lFlags = DDSD_CAPS
  308.     SpriteD(8).ddsCaps.lCaps = DDSCAPS_OFFSCREENPLAIN Or DDSCAPS_SYSTEMMEMORY
  309.     
  310. #If RunInIDE = 1 Then
  311.     'ide
  312.     Set Sprites(8) = DD.CreateSurfaceFromFile("dance.bmp", SpriteD(8))
  313. #Else
  314.     'exe
  315.     Set Sprites(8) = DD.CreateSurfaceFromResource(AddDirSep(App.Path) & App.EXEName & ".exe", "dance", SpriteD(8))
  316. #End If
  317.  
  318.     SpriteR(8).Right = SpriteD(8).lWidth
  319.     SpriteR(8).bottom = SpriteD(8).lHeight
  320.         
  321.     
  322.     
  323.     
  324.     
  325. End Sub
  326.  
  327. Public Sub MoveFrame(Index As Integer)
  328.  
  329.     On Local Error GoTo err_
  330.     
  331.     Select Case Index
  332.         Case 0
  333.             bB.Blt BBR, Sprites(Index), SpriteR(Index), DDBLT_WAIT
  334.             
  335.             
  336.             bB.Lock AlphaRect, BD, DDLOCK_WAIT, 0
  337.             bB.GetLockedArray ar()
  338.                 DoEvents
  339.     
  340.                 clr = Rnd * 255
  341.                 
  342.                 For y = 0 To (AlphaRect.bottom - 1)
  343.                 For x = 0 To (AlphaRect.Right - 1) * 2
  344.         
  345.                     If ar(x, y) <> 0 And ar(x, y) <> 64 And ar(x, y) <> 255 And ar(x, y) <> 127 Then
  346.                             If ar(x, y) = 224 Then
  347.                                 ar(x, y) = clr
  348.                             End If
  349.                     End If
  350.                 Next
  351.                 DoEvents
  352.                 Next
  353.                 DoEvents
  354.                 bB.Unlock AlphaRect
  355.              
  356.             
  357.                 GetWindowRect frmMain.mnCan.hwnd, DR
  358.                 DDS.Blt DR, bB, BBR, DDBLT_WAIT
  359.             
  360.         Case 1
  361.             tmpR.Top = Rnd * 200
  362.             tmpR.Left = Rnd * 50
  363.             
  364.             bB.Blt BBR, Sprites(Index), SpriteR(Index), DDBLT_WAIT
  365.             bB.BltFast tmpR.Left, tmpR.Top, Sprites(6), SpriteR(6), DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY
  366.                         
  367.             
  368.             
  369.             GetWindowRect frmMain.mnCan.hwnd, DR
  370.             DDS.Blt DR, bB, BBR, DDBLT_WAIT
  371.             Sleep 50
  372.             
  373.             
  374.         Case 2
  375.             On Error Resume Next
  376.             Dim nColor As Integer, tmp As Integer
  377.             bB.Blt BBR, Sprites(Index), SpriteR(Index), DDBLT_WAIT
  378.             GetWindowRect frmMain.mnCan.hwnd, DR
  379.             bB.Lock AlphaRect, BD, DDLOCK_WAIT, 0
  380.             bB.GetLockedArray ar()
  381.             DoEvents
  382.             nColor = Rnd * 256
  383.             If nColor = 0 Then nColor = 1
  384.             
  385.             For y = 0 To (AlphaRect.bottom - 1)
  386.             For x = 0 To (AlphaRect.Right - 1) * (lPixelDepth \ 8)
  387.             If ar(x, y) <> 0 And ar(x, y) <> 124 Then
  388.                     ar(x, y) = nColor
  389.             End If
  390.             Next
  391.             DoEvents
  392.             
  393.             Next
  394.             DoEvents
  395.             bB.Unlock AlphaRect
  396.             DDS.Blt DR, bB, BBR, DDBLT_WAIT
  397.             On Error GoTo 0
  398.         Case 3
  399.               
  400.               
  401.             With fi(0)
  402.                 .x = .x + 1: If .x > frmMain.mnCan.ScaleWidth Then .x = 0
  403.                 .y = Sin(.x / 5) * 5 + (frmMain.mnCan.ScaleHeight \ 2)
  404.             End With
  405.  
  406.  
  407.             With fi(1)
  408.                 .x = .x + 2: If .x > frmMain.mnCan.ScaleWidth Then .x = 0
  409.                 .y = Sin(.x / 20) * 20 + (frmMain.mnCan.ScaleHeight \ 4)
  410.             End With
  411.  
  412.             With fi(2)
  413.                 .x = .x - 2: If .x < frmMain.mnCan.ScaleLeft Then .x = frmMain.mnCan.ScaleWidth
  414.                 .y = Sin(.x / 40) * 40 + (frmMain.mnCan.ScaleHeight \ 3)
  415.             End With
  416.               
  417.             Dim i As Integer
  418.             
  419.                 bB.BltColorFill BBR, &H0
  420.                 
  421.             For i = 0 To UBound(fi)
  422.                 bB.BltFast fi(i).x, fi(i).y, Fish(i), fishR(i), DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY
  423.             Next i
  424.                         
  425.             GetWindowRect frmMain.mnCan.hwnd, DR
  426.             DDS.Blt DR, bB, BBR, DDBLT_WAIT
  427.             
  428.             Sleep 50
  429.         Case 5
  430.         
  431.             Dim rSprite As DxVBLib.RECT
  432.             
  433.             currentframe = currentframe + 1
  434.             If currentframe > rows * cols - 1 Then currentframe = 0
  435.             
  436.             col = currentframe Mod cols
  437.             row = Int(currentframe / cols)
  438.             rSprite.Left = col * spriteWidth
  439.             rSprite.Top = row * spriteHeight
  440.             rSprite.Right = rSprite.Left + spriteWidth
  441.             rSprite.bottom = rSprite.Top + spriteHeight
  442.               
  443.            
  444.     
  445.             bB.BltColorFill BBR, &H0
  446.             Set bB = MoveBackRight(bB, Sprites(9), slide)
  447.            
  448.             DoEvents
  449.             
  450.             bB.BltFast 0, frmMain.mnCan.ScaleHeight \ 3, Sprites(Index), rSprite, DDBLTFAST_SRCCOLORKEY Or DDBLTFAST_WAIT
  451.             
  452.                         
  453.             GetWindowRect frmMain.mnCan.hwnd, DR
  454.             DDS.Blt DR, bB, BBR, DDBLT_WAIT
  455.             
  456.             
  457.             Sleep 80
  458.         Case 6
  459.            
  460.            
  461.             bB.Blt BBR, Sprites(8), SpriteR(8), DDBLT_WAIT
  462.             
  463.             
  464.                 bB.Lock AlphaRect, BD, DDLOCK_WAIT, 0
  465.                 bB.GetLockedArray ar()
  466.                 DoEvents
  467.             
  468.     
  469.             For y = 0 To (AlphaRect.bottom - 1)
  470.             For x = 0 To (AlphaRect.Right - 1) * 2
  471.     
  472.             If ar(x, y) <> 0 And ar(x, y) <> 255 Then
  473.                     ar(x, y) = Rnd * 255
  474.             End If
  475.             Next
  476.             DoEvents
  477.             
  478.             Next
  479.             DoEvents
  480.             bB.Unlock AlphaRect
  481.             DDS.Blt DR, bB, BBR, DDBLT_WAIT
  482.            
  483.         
  484.                         
  485.             GetWindowRect frmMain.mnCan.hwnd, DR
  486.             DDS.Blt DR, bB, BBR, DDBLT_WAIT
  487.             
  488. '            Sleep 20
  489.     
  490.     End Select
  491.     
  492.     Exit Sub
  493. err_:
  494.     
  495.     If Not (DD Is Nothing) Then
  496.         DD.SetCooperativeLevel frmMain.hwnd, DDSCL_NORMAL
  497.         DoEvents
  498.     End If
  499.     MsgBox "There was an issue with playing the current frame." & vbCrLf & _
  500.             Err.Number & vbCrLf & _
  501.             Err.Description, vbApplicationModal
  502.     End
  503.     
  504.     
  505. End Sub
  506.  
  507.  
  508. Public Sub StripVert(cChop() As DxVBLib.RECT, wD As Long, hD As Long)
  509.     Dim cntr As Integer
  510.     Dim nN As Long
  511.     Dim sZ As Long
  512.     
  513.     For cntr = 0 To UBound(cChop)
  514.         sZ = wD / UBound(cChop)
  515.         nN = nN + sZ
  516.         
  517.         cChop(cntr).Left = (nN - sZ)
  518.         cChop(cntr).Right = nN
  519.         cChop(cntr).bottom = hD
  520.     Next
  521.     
  522.     'StripVert = cChop
  523.     
  524. End Sub
  525.  
  526. Public Function MoveBackRight(ByVal bB As DirectDrawSurface7, ByVal backgrounds As DirectDrawSurface7, recArray() As DxVBLib.RECT) As DirectDrawSurface7
  527.     Dim tmpC As Integer
  528.     Dim stp As Integer
  529.     Static cntrFR As Integer
  530.     
  531.     For tmpC = 0 To UBound(recArray)
  532.            If cntrFR >= (UBound(recArray) - 1) Then
  533.                cntrFR = 0
  534.            End If
  535.             bB.BltFast recArray(cntrFR).Left, (frmMain.mnCan.ScaleHeight \ 3), backgrounds, recArray(tmpC), DDBLTFAST_WAIT
  536.             cntrFR = cntrFR + 1
  537.            DoEvents
  538.     Next
  539.     
  540.     Set MoveBackRight = bB
  541.     DoEvents
  542. End Function
  543.  
  544. Public Function LoadMSg(Index As Integer) As String
  545.  
  546.     Dim tempMSG(7) As String
  547.     
  548.     'wed
  549.     tempMSG(0) = "Big Band!" & vbCrLf & _
  550.                  "Join us for a blast from the past!  Enjoy cutting the rug " & vbCrLf & _
  551.                  "with the finest big band musicians from the area.  Whether " & vbCrLf & _
  552.                  "you want to swing dance the night away, or just listen to " & vbCrLf & _
  553.                  "the big sound from the stage, you're sure to have a great time." & vbCrLf & _
  554.                  "Just don't forget the zoot suit at home!"
  555.     'thur
  556.     tempMSG(1) = "Jazz Night!" & vbCrLf & _
  557.                  "Thursdays are a big night at Club Met, because our jazz music" & vbCrLf & _
  558.                  "is always cool and fresh.  The musicians that join us are always" & vbCrLf & _
  559.                  "Grade A, including local band Benny HaHa and the Blue Wave." & vbCrLf & _
  560.                  "Jazz has never been better!"
  561.     'fri
  562.     tempMSG(2) = "Disco!" & vbCrLf & _
  563.                  "If the 70's are making a comeback, you'll find Friday Night at Club Met" & vbCrLf & _
  564.                  "to be the headquarters.  Always a blast, we bring in some of the original" & vbCrLf & _
  565.                  "disco artists to play their most popular numbers.  It's even more fun to" & vbCrLf & _
  566.                  "come dressed to the part.  Come once and it's sure to be your Friday Night" & vbCrLf & _
  567.                  "hang out!"
  568.     'sat
  569.     tempMSG(3) = "Dance Night!" & vbCrLf & _
  570.                  "A definite favorite of Generation X (and Y) is Dance night at Club Met." & vbCrLf & _
  571.                  "Our own DJ, Flavor Mike, spins the latest dance hits all night long." & vbCrLf & _
  572.                  "Once you start dancing, you can't slow down.  Plenty of new people to " & vbCrLf & _
  573.                  "meet, and always a good time."
  574.                  
  575.     'sun
  576.     tempMSG(4) = "Classical!" & vbCrLf & _
  577.                  "If your tastes are more refined, we encourage you to join us on Sunday" & vbCrLf & _
  578.                  "night at Club Met.  You'll enjoy intellectual conversation and delightful" & vbCrLf & _
  579.                  "music from the Baroque, Classical, and Romantic eras, played by renowned" & vbCrLf & _
  580.                  "local artists.  A great way to energize yourself for the week ahead."
  581.                  
  582.                  
  583.     LoadMSg = tempMSG(Index)
  584.                  
  585.  
  586. End Function
  587.  
  588.